/****************************************************************************
*  Copyright 2017 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com)       *
*                                                                           *
*  Licensed under the Apache License, Version 2.0 (the "License");          *
*  you may not use this file except in compliance with the License.         *
*  You may obtain a copy of the License at                                  *
*                                                                           *
*     http://www.apache.org/licenses/LICENSE-2.0                            *
*                                                                           *
*  Unless required by applicable law or agreed to in writing, software      *
*  distributed under the License is distributed on an "AS IS" BASIS,        *
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
*  See the License for the specific language governing permissions and      *
*  limitations under the License.                                           *
*                                                                           *
****************************************************************************/


/*============================ INCLUDES ======================================*/
#include ".\app_cfg.h"
#include ".\scheduler\scheduler.h"

/*============================ MACROS ========================================*/
/*============================ MACROFIED FUNCTIONS ===========================*/
/*============================ TYPES =========================================*/
/*============================ GLOBAL VARIABLES ==============================*/
/*============================ LOCAL VARIABLES ===============================*/
/*============================ PROTOTYPES ====================================*/
/*============================ IMPLEMENTATION ================================*/

WEAK void scheduler_init(void)
{
#if TASK_SCHEDULER == ENABLED
    //! initialize scheduler
    static NO_INIT task_t s_tTaskPool[SAFE_TASK_POOL_SIZE];
    CS_HEAP_INIT(s_tTaskPool, sizeof(s_tTaskPool));
#endif
}

//extern void SCHEDULER_INIT(void);

/*! \brief initialize all services
 *! \param none
 *! \retval TRUE initialize services succeed.
 *! \retval FALSE initialize services failed.
 */
bool service_init(void)
{
    scheduler_init();

    return true;
}

